\(\int \frac {(c+a^2 c x^2) \arctan (a x)^2}{x} \, dx\) [262]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 20, antiderivative size = 169 \[ \int \frac {\left (c+a^2 c x^2\right ) \arctan (a x)^2}{x} \, dx=-a c x \arctan (a x)+\frac {1}{2} c \arctan (a x)^2+\frac {1}{2} a^2 c x^2 \arctan (a x)^2+2 c \arctan (a x)^2 \text {arctanh}\left (1-\frac {2}{1+i a x}\right )+\frac {1}{2} c \log \left (1+a^2 x^2\right )-i c \arctan (a x) \operatorname {PolyLog}\left (2,1-\frac {2}{1+i a x}\right )+i c \arctan (a x) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i a x}\right )-\frac {1}{2} c \operatorname {PolyLog}\left (3,1-\frac {2}{1+i a x}\right )+\frac {1}{2} c \operatorname {PolyLog}\left (3,-1+\frac {2}{1+i a x}\right ) \]

[Out]

-a*c*x*arctan(a*x)+1/2*c*arctan(a*x)^2+1/2*a^2*c*x^2*arctan(a*x)^2-2*c*arctan(a*x)^2*arctanh(-1+2/(1+I*a*x))+1
/2*c*ln(a^2*x^2+1)-I*c*arctan(a*x)*polylog(2,1-2/(1+I*a*x))+I*c*arctan(a*x)*polylog(2,-1+2/(1+I*a*x))-1/2*c*po
lylog(3,1-2/(1+I*a*x))+1/2*c*polylog(3,-1+2/(1+I*a*x))

Rubi [A] (verified)

Time = 0.23 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {5070, 4942, 5108, 5004, 5114, 6745, 4946, 5036, 4930, 266} \[ \int \frac {\left (c+a^2 c x^2\right ) \arctan (a x)^2}{x} \, dx=\frac {1}{2} a^2 c x^2 \arctan (a x)^2+\frac {1}{2} c \log \left (a^2 x^2+1\right )+2 c \arctan (a x)^2 \text {arctanh}\left (1-\frac {2}{1+i a x}\right )-i c \arctan (a x) \operatorname {PolyLog}\left (2,1-\frac {2}{i a x+1}\right )+i c \arctan (a x) \operatorname {PolyLog}\left (2,\frac {2}{i a x+1}-1\right )+\frac {1}{2} c \arctan (a x)^2-a c x \arctan (a x)-\frac {1}{2} c \operatorname {PolyLog}\left (3,1-\frac {2}{i a x+1}\right )+\frac {1}{2} c \operatorname {PolyLog}\left (3,\frac {2}{i a x+1}-1\right ) \]

[In]

Int[((c + a^2*c*x^2)*ArcTan[a*x]^2)/x,x]

[Out]

-(a*c*x*ArcTan[a*x]) + (c*ArcTan[a*x]^2)/2 + (a^2*c*x^2*ArcTan[a*x]^2)/2 + 2*c*ArcTan[a*x]^2*ArcTanh[1 - 2/(1
+ I*a*x)] + (c*Log[1 + a^2*x^2])/2 - I*c*ArcTan[a*x]*PolyLog[2, 1 - 2/(1 + I*a*x)] + I*c*ArcTan[a*x]*PolyLog[2
, -1 + 2/(1 + I*a*x)] - (c*PolyLog[3, 1 - 2/(1 + I*a*x)])/2 + (c*PolyLog[3, -1 + 2/(1 + I*a*x)])/2

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 4930

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x^n])^p, x] - Dist[b*c
*n*p, Int[x^n*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))), x], x] /; FreeQ[{a, b, c, n}, x] && IGtQ[p, 0
] && (EqQ[n, 1] || EqQ[p, 1])

Rule 4942

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_)/(x_), x_Symbol] :> Simp[2*(a + b*ArcTan[c*x])^p*ArcTanh[1 - 2/(1 +
 I*c*x)], x] - Dist[2*b*c*p, Int[(a + b*ArcTan[c*x])^(p - 1)*(ArcTanh[1 - 2/(1 + I*c*x)]/(1 + c^2*x^2)), x], x
] /; FreeQ[{a, b, c}, x] && IGtQ[p, 1]

Rule 4946

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*((a + b*ArcTan[c*x^
n])^p/(m + 1)), x] - Dist[b*c*n*(p/(m + 1)), Int[x^(m + n)*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))),
x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] && IntegerQ[m])) && NeQ[m, -1]

Rule 5004

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 5036

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[f^2/
e, Int[(f*x)^(m - 2)*(a + b*ArcTan[c*x])^p, x], x] - Dist[d*(f^2/e), Int[(f*x)^(m - 2)*((a + b*ArcTan[c*x])^p/
(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && GtQ[m, 1]

Rule 5070

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_)*((d_) + (e_.)*(x_)^2)^(q_.), x_Symbol] :> Dist[
d, Int[(f*x)^m*(d + e*x^2)^(q - 1)*(a + b*ArcTan[c*x])^p, x], x] + Dist[c^2*(d/f^2), Int[(f*x)^(m + 2)*(d + e*
x^2)^(q - 1)*(a + b*ArcTan[c*x])^p, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[e, c^2*d] && GtQ[q, 0] &&
 IGtQ[p, 0] && (RationalQ[m] || (EqQ[p, 1] && IntegerQ[q]))

Rule 5108

Int[(ArcTanh[u_]*((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[1/2, Int[L
og[1 + u]*((a + b*ArcTan[c*x])^p/(d + e*x^2)), x], x] - Dist[1/2, Int[Log[1 - u]*((a + b*ArcTan[c*x])^p/(d + e
*x^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[e, c^2*d] && EqQ[u^2 - (1 - 2*(I/(I - c*x)))^
2, 0]

Rule 5114

Int[(Log[u_]*((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(-I)*(a + b*Ar
cTan[c*x])^p*(PolyLog[2, 1 - u]/(2*c*d)), x] + Dist[b*p*(I/2), Int[(a + b*ArcTan[c*x])^(p - 1)*(PolyLog[2, 1 -
 u]/(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[e, c^2*d] && EqQ[(1 - u)^2 - (1 - 2
*(I/(I - c*x)))^2, 0]

Rule 6745

Int[(u_)*PolyLog[n_, v_], x_Symbol] :> With[{w = DerivativeDivides[v, u*v, x]}, Simp[w*PolyLog[n + 1, v], x] /
;  !FalseQ[w]] /; FreeQ[n, x]

Rubi steps \begin{align*} \text {integral}& = c \int \frac {\arctan (a x)^2}{x} \, dx+\left (a^2 c\right ) \int x \arctan (a x)^2 \, dx \\ & = \frac {1}{2} a^2 c x^2 \arctan (a x)^2+2 c \arctan (a x)^2 \text {arctanh}\left (1-\frac {2}{1+i a x}\right )-(4 a c) \int \frac {\arctan (a x) \text {arctanh}\left (1-\frac {2}{1+i a x}\right )}{1+a^2 x^2} \, dx-\left (a^3 c\right ) \int \frac {x^2 \arctan (a x)}{1+a^2 x^2} \, dx \\ & = \frac {1}{2} a^2 c x^2 \arctan (a x)^2+2 c \arctan (a x)^2 \text {arctanh}\left (1-\frac {2}{1+i a x}\right )-(a c) \int \arctan (a x) \, dx+(a c) \int \frac {\arctan (a x)}{1+a^2 x^2} \, dx+(2 a c) \int \frac {\arctan (a x) \log \left (\frac {2}{1+i a x}\right )}{1+a^2 x^2} \, dx-(2 a c) \int \frac {\arctan (a x) \log \left (2-\frac {2}{1+i a x}\right )}{1+a^2 x^2} \, dx \\ & = -a c x \arctan (a x)+\frac {1}{2} c \arctan (a x)^2+\frac {1}{2} a^2 c x^2 \arctan (a x)^2+2 c \arctan (a x)^2 \text {arctanh}\left (1-\frac {2}{1+i a x}\right )-i c \arctan (a x) \operatorname {PolyLog}\left (2,1-\frac {2}{1+i a x}\right )+i c \arctan (a x) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i a x}\right )+(i a c) \int \frac {\operatorname {PolyLog}\left (2,1-\frac {2}{1+i a x}\right )}{1+a^2 x^2} \, dx-(i a c) \int \frac {\operatorname {PolyLog}\left (2,-1+\frac {2}{1+i a x}\right )}{1+a^2 x^2} \, dx+\left (a^2 c\right ) \int \frac {x}{1+a^2 x^2} \, dx \\ & = -a c x \arctan (a x)+\frac {1}{2} c \arctan (a x)^2+\frac {1}{2} a^2 c x^2 \arctan (a x)^2+2 c \arctan (a x)^2 \text {arctanh}\left (1-\frac {2}{1+i a x}\right )+\frac {1}{2} c \log \left (1+a^2 x^2\right )-i c \arctan (a x) \operatorname {PolyLog}\left (2,1-\frac {2}{1+i a x}\right )+i c \arctan (a x) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i a x}\right )-\frac {1}{2} c \operatorname {PolyLog}\left (3,1-\frac {2}{1+i a x}\right )+\frac {1}{2} c \operatorname {PolyLog}\left (3,-1+\frac {2}{1+i a x}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.08 \[ \int \frac {\left (c+a^2 c x^2\right ) \arctan (a x)^2}{x} \, dx=-a c x \arctan (a x)+\frac {1}{2} c \left (1+a^2 x^2\right ) \arctan (a x)^2+\frac {2}{3} i c \arctan (a x)^3+c \arctan (a x)^2 \log \left (1-e^{-2 i \arctan (a x)}\right )-c \arctan (a x)^2 \log \left (1+e^{2 i \arctan (a x)}\right )+\frac {1}{2} c \log \left (1+a^2 x^2\right )+i c \arctan (a x) \operatorname {PolyLog}\left (2,e^{-2 i \arctan (a x)}\right )+i c \arctan (a x) \operatorname {PolyLog}\left (2,-e^{2 i \arctan (a x)}\right )+\frac {1}{2} c \operatorname {PolyLog}\left (3,e^{-2 i \arctan (a x)}\right )-\frac {1}{2} c \operatorname {PolyLog}\left (3,-e^{2 i \arctan (a x)}\right ) \]

[In]

Integrate[((c + a^2*c*x^2)*ArcTan[a*x]^2)/x,x]

[Out]

-(a*c*x*ArcTan[a*x]) + (c*(1 + a^2*x^2)*ArcTan[a*x]^2)/2 + ((2*I)/3)*c*ArcTan[a*x]^3 + c*ArcTan[a*x]^2*Log[1 -
 E^((-2*I)*ArcTan[a*x])] - c*ArcTan[a*x]^2*Log[1 + E^((2*I)*ArcTan[a*x])] + (c*Log[1 + a^2*x^2])/2 + I*c*ArcTa
n[a*x]*PolyLog[2, E^((-2*I)*ArcTan[a*x])] + I*c*ArcTan[a*x]*PolyLog[2, -E^((2*I)*ArcTan[a*x])] + (c*PolyLog[3,
 E^((-2*I)*ArcTan[a*x])])/2 - (c*PolyLog[3, -E^((2*I)*ArcTan[a*x])])/2

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 18.39 (sec) , antiderivative size = 1055, normalized size of antiderivative = 6.24

method result size
derivativedivides \(\text {Expression too large to display}\) \(1055\)
default \(\text {Expression too large to display}\) \(1055\)
parts \(\text {Expression too large to display}\) \(1545\)

[In]

int((a^2*c*x^2+c)*arctan(a*x)^2/x,x,method=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*csgn(I/((1+I*a*x)
^2/(a^2*x^2+1)+1))*csgn(I*((1+I*a*x)^2/(a^2*x^2+1)-1)/((1+I*a*x)^2/(a^2*x^2+1)+1))^2*arctan(a*x)^2+2*I*arctan(
a*x)*polylog(2,-(1+I*a*x)/(a^2*x^2+1)^(1/2))-1/2*I*Pi*arctan(a*x)^2+2*I*arctan(a*x)*polylog(2,(1+I*a*x)/(a^2*x
^2+1)^(1/2))-1/2*I*Pi*csgn(I*((1+I*a*x)^2/(a^2*x^2+1)-1))*csgn(I/((1+I*a*x)^2/(a^2*x^2+1)+1))*csgn(I*((1+I*a*x
)^2/(a^2*x^2+1)-1)/((1+I*a*x)^2/(a^2*x^2+1)+1))*arctan(a*x)^2-I*arctan(a*x)*polylog(2,-(1+I*a*x)^2/(a^2*x^2+1)
))

Fricas [F]

\[ \int \frac {\left (c+a^2 c x^2\right ) \arctan (a x)^2}{x} \, dx=\int { \frac {{\left (a^{2} c x^{2} + c\right )} \arctan \left (a x\right )^{2}}{x} \,d x } \]

[In]

integrate((a^2*c*x^2+c)*arctan(a*x)^2/x,x, algorithm="fricas")

[Out]

integral((a^2*c*x^2 + c)*arctan(a*x)^2/x, x)

Sympy [F]

\[ \int \frac {\left (c+a^2 c x^2\right ) \arctan (a x)^2}{x} \, dx=c \left (\int \frac {\operatorname {atan}^{2}{\left (a x \right )}}{x}\, dx + \int a^{2} x \operatorname {atan}^{2}{\left (a x \right )}\, dx\right ) \]

[In]

integrate((a**2*c*x**2+c)*atan(a*x)**2/x,x)

[Out]

c*(Integral(atan(a*x)**2/x, x) + Integral(a**2*x*atan(a*x)**2, x))

Maxima [F]

\[ \int \frac {\left (c+a^2 c x^2\right ) \arctan (a x)^2}{x} \, dx=\int { \frac {{\left (a^{2} c x^{2} + c\right )} \arctan \left (a x\right )^{2}}{x} \,d x } \]

[In]

integrate((a^2*c*x^2+c)*arctan(a*x)^2/x,x, algorithm="maxima")

[Out]

1/8*a^2*c*x^2*arctan(a*x)^2 - 1/32*a^2*c*x^2*log(a^2*x^2 + 1)^2 + 12*a^4*c*integrate(1/16*x^4*arctan(a*x)^2/(a
^2*x^3 + x), x) + a^4*c*integrate(1/16*x^4*log(a^2*x^2 + 1)^2/(a^2*x^3 + x), x) + 2*a^4*c*integrate(1/16*x^4*l
og(a^2*x^2 + 1)/(a^2*x^3 + x), x) - 4*a^3*c*integrate(1/16*x^3*arctan(a*x)/(a^2*x^3 + x), x) + 24*a^2*c*integr
ate(1/16*x^2*arctan(a*x)^2/(a^2*x^3 + x), x) + 1/48*c*log(a^2*x^2 + 1)^3 + 12*c*integrate(1/16*arctan(a*x)^2/(
a^2*x^3 + x), x) + c*integrate(1/16*log(a^2*x^2 + 1)^2/(a^2*x^3 + x), x)

Giac [F]

\[ \int \frac {\left (c+a^2 c x^2\right ) \arctan (a x)^2}{x} \, dx=\int { \frac {{\left (a^{2} c x^{2} + c\right )} \arctan \left (a x\right )^{2}}{x} \,d x } \]

[In]

integrate((a^2*c*x^2+c)*arctan(a*x)^2/x,x, algorithm="giac")

[Out]

sage0*x

Mupad [F(-1)]

Timed out. \[ \int \frac {\left (c+a^2 c x^2\right ) \arctan (a x)^2}{x} \, dx=\int \frac {{\mathrm {atan}\left (a\,x\right )}^2\,\left (c\,a^2\,x^2+c\right )}{x} \,d x \]

[In]

int((atan(a*x)^2*(c + a^2*c*x^2))/x,x)

[Out]

int((atan(a*x)^2*(c + a^2*c*x^2))/x, x)